* stata version 15


 * now for Study II: 2013 analysis

use "/Users/davidbarker/Google Drive/Research/Facts and Premises/Premises 13  Harvard Dataverse 7 2020.dta"

* making the issue ideology factor

factor debtcripfalse01 crimesocialnotpunish supportACA affirmactsupport envirooverjobs abortprochoice immigrantlegal gunbanassrifles afghanmistake iraqmistake supportgaymarriage, ml factors (1)
predict ideolissuefactor1101
sum ideolissuefactor1101
replace ideolissuefactor1101 = ideolissuefactor1101+  1.906932
sum ideolissuefactor1101
replace ideolissuefactor1101 = ideolissuefactor1101 / 3.808161

* making the humannature selfish and competitive measure, which is a summed index of two survey items
gen premhumanselfishcompete201 = (prem_peoplecoopvscompete01+ prem_pplseekowninterest01) /2

* making the progress skepticism factor
factor UML15noskip UML14noskip UML13noskip UML12noskip, ml factors (1)
predict prem_progskepticalfactor
gen prem_progskeptfactor01 = prem_progskepticalfactor + 1.260103
replace prem_progskeptfactor01 = prem_progskeptfactor01 /3.701029
sum prem_progskeptfactor01

*making the societyfragile factor

factor UML07noskip UML08noskip UML09noskip UML10noskip UML11noskip, ml factors (1)
predict prem_socfragilefactor01
sum prem_socfragilefactor01
replace prem_socfragilefactor01 = prem_socfragilefactor01 + 1.2696
sum prem_socfragilefactor01
replace prem_socfragilefactor01 = prem_socfragilefactor01 / 2.566818
replace prem_socfragilefactor01 = prem_socfragilefactor01*-1
sum prem_socfragilefactor01
replace prem_socfragilefactor01 = prem_socfragilefactor01 + 1.49462

* running the regressions: first, using the three-point ideological identification outcome variable
gologit2 ideo301 commun_indiv01 pacif_militarism01 newways_trad01 premhumanselfishcompete201 prem_progskeptfactor01 prem_socfragilefactor01 female white educ01 age01 famincnom01, or cluster (cdid113)

* next, the 11 point policy ideology factor outcome variable
reg ideolissuefactor1101 commun_indiv01 pacif_militarism01 newways_trad01 premhumanselfishcompete201 prem_progskeptfactor01 prem_socfragilefactor01 female white educ01 age01 famincnom01, cluster (cdid113)

